feat(remix): Add support for Remix SPA Mode - #3580
Conversation
🦋 Changeset detectedLatest commit: 3dd2c03 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
!snapshot |
|
Hey @anagstef - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/chrome-extension@1.0.19-snapshot.vbc54be6 --save-exact
npm i @clerk/clerk-js@5.7.1-snapshot.vbc54be6 --save-exact
npm i @clerk/elements@0.8.0-snapshot.vbc54be6 --save-exact
npm i @clerk/clerk-expo@1.2.2-snapshot.vbc54be6 --save-exact
npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact
npm i @clerk/remix@4.2.0-snapshot.vbc54be6 --save-exact |
|
!snapshot |
|
!snapshot |
|
Hey @anagstef - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/chrome-extension@1.1.1-snapshot.ve39e3a5 --save-exact
npm i @clerk/clerk-js@5.7.3-snapshot.ve39e3a5 --save-exact
npm i @clerk/clerk-expo@1.2.4-snapshot.ve39e3a5 --save-exact
npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact
npm i @clerk/remix@4.2.0-snapshot.ve39e3a5 --save-exact |
|
!snapshot |
|
Hey @anagstef - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/chrome-extension@1.1.1-snapshot.vdf60950 --save-exact
npm i @clerk/clerk-js@5.7.3-snapshot.vdf60950 --save-exact
npm i @clerk/clerk-expo@1.2.4-snapshot.vdf60950 --save-exact
npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact
npm i @clerk/remix@4.2.0-snapshot.vdf60950 --save-exact |
| if (typeof window !== 'undefined' && typeof window.__remixContext?.isSpaMode !== 'undefined') { | ||
| return window.__remixContext.isSpaMode; | ||
| } |
There was a problem hiding this comment.
@anagstef could you add a link where window.__remixContext.isSpaMode is mentioned in their docs ? I couldn't find it.
There was a problem hiding this comment.
@panteliselef It's not mentioned because it is kinda internal. My initial proposal was to introduce a spaMode: true prop option, but discussed with @octoper and this solution has better DX.
Description
This PR adds support for the Remix SPA Mode. ref: https://remix.run/docs/en/main/guides/spa-mode
After users have followed the Remix guide to use the SPA mode in their app, they'll need to make the following changes in their Clerk Remix app:
rootAuthLoaderClerkAppcomponent (except Clerk's Secret Key)"@clerk/remix/ssr.server")An example
app/root.tsxpage that uses SPA Mode, could be the following:Checklist
npm testruns as expected.npm run buildruns as expected.Type of change